<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //用setTimeout模拟 A成功后调用B, B成功后调用C


    let fn1 = new Promise(function(resolve, reject){
        setTimeout(()=>{
            resolve();
            console.log("A")
        }, 3000)
    })

    let fn2 = fn1.then(
        success =>{
            return new Promise(function(resolve, reject){
                setTimeout(()=>{
                    resolve();
                    console.log("B")
                }, 1000)
            })
        }
    )

    fn2.then(
        success =>{
            console.log("C")
        }
    );


</script>
</body>
</html>